package com.sdx.console.person.service;

import java.util.List;

import com.ibeetl.admin.core.entity.BaseEntity;
import com.sdx.console.customer.entity.CustomerInfo;
import org.beetl.sql.core.engine.PageQuery;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ibeetl.admin.core.util.PlatformException;

import com.sdx.console.person.dao.CustomerExtInfoDao;
import com.sdx.console.person.entity.CustomerExtInfo;
import com.ibeetl.admin.core.service.BaseService;

/**
 * 老师 Service
 */

@Service
@Transactional
public class CustomerExtInfoService extends BaseService<CustomerExtInfo>{

    @Resource
	private CustomerExtInfoDao customerExtInfoDao;

    public PageQuery<CustomerExtInfo>queryByCondition(PageQuery query){
        PageQuery ret =  customerExtInfoDao.queryByCondition(query);
        queryListAfter(ret.getList());
        return ret;
    }

    public void batchDelCustomerExtInfo(List<String> ids){
        try {
            customerExtInfoDao.batchDelCustomerExtInfoByIds(ids);
        } catch (Exception e) {
            throw new PlatformException("批量删除老师失败", e);
        }
    }

	public List<CustomerExtInfo> all() {
		return customerExtInfoDao.all();
		}

    public List<CustomerInfo> selectTeacher(Integer orgId) {
        return customerExtInfoDao.selectTeacher(orgId);
    }
}